<template>
    <el-form :model="form" label-width="auto" style="max-width: 600px">
        <el-form-item label="用户名">
            <el-input v-model="form.name" />
        </el-form-item>
        <el-form-item label="性别">
            <el-select v-model="form.sex" placeholder="请选择你的性别">
                <el-option label="男" value="男" />
                <el-option label="女" value="女" />
            </el-select>
        </el-form-item>
        <el-form-item label="出生日期">
            <el-col :span="11">
                <el-date-picker v-model="form.birthday" type="date" placeholder="Pick a date" style="width: 100%" />
            </el-col>
        </el-form-item>
        <el-form-item label="职业">
            <el-input v-model="form.work" />
        </el-form-item>

        <el-form-item label="个人介绍">
            <el-input v-model="form.intro" type="textarea" />
        </el-form-item>
        <el-form-item label="手机号">
            <el-input v-model="form.phone" />
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">创建</el-button>
            <el-button>取消</el-button>
        </el-form-item>
    </el-form>
</template>

<script lang="ts" setup>
import { reactive } from 'vue'

// do not use same name with ref
const form = reactive({
    name: '',
    sex: '',
    birthday: '',
    work: '',
    intro: '',
    phone: '',
})

const onSubmit = () => {
    alert('submit!')
}
</script>
